import base64
import hashlib

def encrype(str):
    hash = hashlib.sha1()
    hash.update(str.encode('utf-8'))
    psd = hash.hexdigest()
    pwdStr = base64.encodebytes(psd.encode("utf-8")).decode('utf-8')
    pwd = base64.decodebytes(pwdStr.encode("utf-8")).decode('utf-8')
    return pwd

def decrype(str):
    return base64.decodebytes(str.encode("utf-8")).decode('utf-8')